//@ sourceURL=WorkMainForm.js
WorkMainForm = Ext.extend(Ext.Window,
{
    constructor : function(a) {
        Ext.applyIf(this, a);
        this.initUIComponents();
        WorkMainForm.superclass.constructor.call(this, {
            layout : "fit",
            id : this.inputFormName,
            items : yearGridFormPanel,
            modal : true,
            bodyStyle : "padding:2px;",
            buttonAlign : "center",
            buttons : yearGridFormButtons,
            title : "工作要点添加",
            iconCls : "menu-flowWait",
            width : 620,
            height : 450
        });
    },
    //初始化数据
    initUIComponents : function() {
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/saferesponsibility/saveWorkMain.do",
                items:[
                {
                    id : "workMain.id",
                    name : "workMain.id",
                    xtype : "hidden",
                    value : this.id == null ? "": this.id
                }, {
                    name : "workMain.years",
                    xtype : "hidden",
                    id : "workMain.years",
                    value : this.years == null ? "" : this.years
                },{
                   layout:"column",
                   bodyStyle:"padding:5px;",
                   items:[{
                       layout:"form",
                       columnWidth:.5,
                       border:false,
                       bodyStyle:"padding:5px;",
//                     True表示为显示出面板body元素的边框，false则隐藏
                       defaultType:"textfield",
                       items:[{
                           fieldLabel:'所属机构'+'<font color=red>*</font>',
                           id:"workMain.institution",
                           name:"workMain.institution",
                           width:146,
                           allowBlank:false,
                           blankText:"所属机构不能为空！"
                       }]
                   },{
                       layout:"form",
                       columnWidth:.5,
                       border:false,
                       bodyStyle:"padding:5px;",
                       defaultType:"textfield",
                       items:[{
                           fieldLabel:'规划名称'+'<font color=red>*</font>',
                           id:"workMain.planName",
                           name:"workMain.planName",
                           width:146,
                           allowBlank:false,
                           blankText:"规划名称不能为空！"
                       }]
                   },{
                       layout:"form",
                       border:false,
                       bodyStyle:"padding:5px;",
                       columnWidth:.5,
                       items:[{
                              //下拉选型设置
                              fieldLabel : "规划等级",
                              hiddenName : "workMain.planLevel",
                              xtype : "combo",
                              mode : "local",
                              editable : false,
                              width:146,
                              triggerAction : "all",
                              store : [
                                      [ "1", "班组级" ],
                                      [ "2", "部门级" ],
                                      [ "3", "企业级" ] ],
                              value : 3
                       }]
                   },{
                       layout:"form",
                       border:false,
                       bodyStyle:"padding:5px;",
                       columnWidth:.5,
                       items:[{
                              //下拉选型设置
                              fieldLabel : "规划类别",
                              hiddenName : "workMain.planType",
                              xtype : "combo",
                              mode : "local",
                              editable : false,
                              width:146,
                              triggerAction : "all",
                              store : [
                                      [ "1", "生产计划" ],
                                      [ "2", "劳动工资计划" ],
                                      [ "3", "财务计划" ], 
                                      [ "4", "技术组织措施计划" ],
                                      [ "5", "其他计划" ] ],
                              value : 3
                       }]
                   },{
                       layout:"form",
                       border:false,
                       bodyStyle:"padding:5px;",
                       columnWidth:.5,
                       items:[{
                           xtype:"datefield",
                           fieldLabel:'上传时间'+'<font color=red>*</font>',
                           id:"workMain.uploadDate",
                           format:"y-m-d",
                           name:"workMain.uploadDate",
                           width:146,
                           allowBlank:false,
                           blankText:"上传时间不能为空！"
                       }]
                   }]
                   },{
                       layout : "column",
                             border:false,
                       items : [{
                       layout:"form",
                       bodyStyle:"padding:5px;",
                       columnWidth:1.,
                       items:[{
                       xtype:"textarea", 
                       fieldLabel: '规划内容', 
                       name: 'workMain.planContent', 
                       width : 448 
                       }]
                   },{
                       columnWidth:1.,//第一列 
                       layout:"form", 
           //            border : false,
                       bodyStyle:"padding:5px;",
                       items:[{ 
                           xtype:"textarea", 
                           fieldLabel: '备注', 
                           name: 'workMain.remark', 
                           width:448 
                           }] 
                   }]
               }
               ]
            },
            loadData:{
                getUrl:__ctxPath +"/saferesponsibility/getWorkMain.do",
                preName : "workMain"
            },
            isShow : this.isShow
        });
    }
});
